import {Component} from "@angular/core";
import {Category} from "./entity/category";
import {CategoryService} from "./service/category.service";
/**
 * Created by Administrator on 2016/8/2.
 */
@Component({
    selector:"category",
    templateUrl:"./app/category.html",
    providers:[CategoryService]
})
export class CategoryComponent{
    private parents:Category[];

    private categoryService:CategoryService;

    constructor(categoryService:CategoryService){
        this.categoryService = categoryService;
        categoryService.getParents().subscribe(result=>this.parents = result.json());
    }
}